ColorOn XFCN returns TRUE if the monitor is currently in color mode and FALSE if it is in monochrome.
It first checks to see if color QuickDraw is supported. If color QuickDraw is present, it then quizzes the graphics device for its color/monochrome setting.
If you use this XFCN on a Macintosh containing a non-standard color graphics device (such as the Mac SE Orchard card) it will still return a value of FALSE because true color QuickDraw is not being used.
If you use this XFCN in a multiple screen environment it will return TRUE if ANY of the graphics devices is displaying color.
See the script of the "Who did this?" button on card 1 for a demo of this XFCN.
• Click here to go there now. •
-- part contents for background part 15
----- text -----
PrintDoc XCMD 1.03
©Copyright 1988,1989 by Jay Hodgdon
PrintDoc XCMD prints the contents of a field or variable (up to 32K) in your choice of font and size. Pages will be numbered and contain a centered header at the top. A print-cancel box is presented, allowing the user to cancel the print job.
<header> is a string that will appear at the top of each printed page;
<container> is a field or variable that contains what will be printed;
<variable> is a string that will appear in the "print cancel" dialog and in the long narrow LaserWriter status dialog;
<font> is the font that <container> will be printed in;
<size> is the font size.
If the specified font is missing, Geneva will be substituted.
The header that is printed on each page will be in Times 12. It will be centered on the page.
Each page will be numbered (at the bottom center) in Times 12.
The print set-up (not the PAGE set-up) dialog will be presented. If the user clicks Cancel the result returned by the XCMD will be "Print job canceled." If the user clicks OK a dialog will appear that will contain <variable> in the string "Printing <variable>" and "Type command-. to Cancel." The first string will ALWAYS be centered within the dialog, regardless of the length of <variable> (unless it overruns the width of the box). This dialog will be centered on the screen (NOT on the card window), just below where the laserwriter status dialog is displayed.
If the user types Command-period during printing, the print job will be cancelled and the cancel dialog will be dismissed. The result will be empty.
If the print job is successful the result will be empty.
Error codes returned in the result are:
Error: There is nothing to print!
Error: Can only print 32000 characters at a time!
If you don't wish to have the cancel dialog displayed, omit the DLOG/DITL resources (ID 5100) from your stack. I recommend that you use it. (You cannot renumber these resources.)
Revision history:
Version 1.03 4/2/89
has better error handling for situations where the LaserWriter is turned off when trying to print or when the "printing" files are missing from the System Folder. It also fixes a gross bug where the XCMD would crash the machine if the printing DLOG/DITLs were missing from the stack.
-- part contents for background part 17
----- text -----
ClipToPICT XFCN 1.2
©Copyright 1988,1989 by Jay Hodgdon
ClipToPICT XFCN converts whatever picture is on the clipboard into a PICT resource and places it in the current stack, any other stack, or into a new file (that is "double-clickable" by ResEdit).
<new PICT resource ID> is the resource ID number for the new PICT;
<new PICT name> is the name of the new PICT resource;
<where> specifies if the PICT is to be inserted into the current stack, any other stack, or into a new file. This parameter must be "this", "other", or "file".
If the <where> parameter is:
"this" then the PICT is inserted into the current stack.
"other" then the PICT is inserted into another stack. The standard file box is displayed for selection of the stack.
"file" then the standard file box is displayed allowing you to create a new file that will contain the PICT resource. This file is "double-clickable" by ResEdit.
If you pass "0" (that's a zero) as the first parameter, ClipToPICT will assign its own unique ID to the new resource.
If you leave the second parameter empty (that doesn't mean that you can OMIT the second parameter) then the new PICT will be unnamed.
If everything goes alright, the ID of the new PICT resource will be returned by the function. If something goes wrong the following errors are returned:
Form: ClipToPICT(<PICT ID>,<PICT name>,<where>)
Error: That PICT resource ID already exists!
Error: That PICT name already exists!
Error: There isn't a picture on the clipboard!
Error: Unable to open the stack!
Any disk related errors will be reported by:
Error: Resource not found
Error: Resource file not found
Error: ClipToPICT failed to add resource
Error: RmveResource failed
Error: Attribute does not permit operation
Error: Map does not permit operation
Error: Disk is full
Error: Disk is locked
Error: File is locked
or other nonspecific errors in the form:
Error: <OSError>
where <OSError> is one of the standard Macintosh operating system error codes.
As you can deduce from the error messages, ClipToPICT will not write over a previously existing PICT resource if it has the same ID or name as the new one. If there isn't anything on the clipboard (or there is text), ClipToPICT will exit (with a beep) without creating a resource.
See the script of PICT Maker for a demo of the XCMD.
• Click here to go there now. •
Revision history:
1.0
initial release
1.11 12/22/88
The newly created PICT resource is made purgeable.
1.2 5/5/89
Rewrote ClipToPICT so that it can insert a newly created PICT into any other stack, or a new file, in addition to the current stack.
-- part contents for background part 18
----- text -----
Ants XFCN 1.2
©Copyright 1988,1989 by Jay Hodgdon
Ants XFCN returns the coordinates of a rectangle drawn out with the mouse. When Ants is "active" it changes the cursor into the cross-hair. Then when the user clicks the mouse, a marquee-style rectangle will be drawn out on the screen.
on mouseUp
put Ants() into theRect
end mouseUp
Ants XFCN produces one error message:
Error: Not enough momory to make bitmap.
It will beep if this happens.
See the script of PICT Maker for a demo of this XFCN.
• Click here to go there now. •
Revision history:
1.0 11/13/88
Ants draws a rectangle on the screen, but don't march!
1.1 12/17/88
Made the Ants march.
1.2 5/10/89
Converted Ants to an offscreen bitmap and used CopyBits to eliminate screen flicker when drawing the rectangle. Ants now also forces the event queue to be flushed so that the mouseclick that draws out the rectangle isn't passed along to HyperCard.
-- part contents for background part 30
----- text -----
22
-- part contents for card part 6
----- text -----
These X-commands were used in the preparation of this stack, and are part of the ShowDialog "package."